<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" 
	template="/WEB-INF/templates/template.xhtml">
	
	
	<ui:define name="headIncludes">
		<f:event listener="#{perfilBean.initializeForm(param.perfilId)}" type="preRenderView"/>
	</ui:define>
	
	<ui:define name="pageName">Detalhe de Perfil</ui:define>
	<ui:define name="buttons">
		<p:commandButton value="Editar" style="height:28px;" action="#{perfilBean.changeToEdit}" icon="ui-icon-pencil"/>
		<p:commandButton value="Excluir" style="height:28px;" onclick="popupConfirmDeleteDetail.show()" icon="ui-icon-trash"/>
		<p:commandButton value="Voltar" style="height:28px;" action="#{perfilBean.changeToList}" process="@this" icon="ui-icon-arrowreturnthick-1-w"/>		
	</ui:define>
	
	<ui:define name="content">	
		<p:panel>
			<div>
				<p:messages autoUpdate="true" closable="true"/>
				<h:panelGrid columns="1" style="padding:5px;">
					<h:outputText style="font-weight:bold;" value="Código" />
					<h:outputText value="#{perfilBean.currentPerfil.id}"/>
				</h:panelGrid>
				
				<h:panelGrid columns="1" style="padding:5px;">
					<h:outputText style="font-weight:bold;" value="Perfil" />
					<h:outputText value="#{perfilBean.currentPerfil.perfil}"/>
				</h:panelGrid>
		
			</div>
		</p:panel>		
	</ui:define>
	
	<ui:define name="popups">
	
		<p:dialog appendToBody="true" modal="true" closable="false" widgetVar="popupConfirmDeleteDetail"
			width="300" resizable="false" header="Confirmação de exclusão" height="90">
			<h:form>
				<div style="margin-top: 10px;">
					<h:outputText value="Confirma a exclusão do registro?"/>
				</div>
				<div align="right" style="margin-top: 15px; margin-bottom: 15px;">
					<p:commandButton value="Excluir" actionListener="#{perfilBean.removeFromDetail}" oncomplete="popupConfirmDeleteDetail.hide()" icon="ui-icon-trash"/>
					<p:commandButton value="Cancelar" onclick="popupConfirmDeleteDetail.hide()" icon="ui-icon-cancel"/>
				</div>		
			</h:form>			
		</p:dialog>
		
		<p:dialog id="completeDialogDelete" header="Confirmação de exclusão" closable="false"
			widgetVar="completeDeletePopup" width="300" resizable="false">
			<h:form>
			<div style="margin-top: 10px;">Excluído com sucesso!</div>
			
			<div align="right" style="margin-top: 15px; margin-bottom: 15px;"> 
				<p:commandButton id="complete" value="Fechar" oncomplete="completeDeletePopup.hide()"   icon="ui-icon-close"
					action="#{perfilBean.changeToList}" />
			</div>
			</h:form>
		</p:dialog>

	</ui:define>
	
</ui:composition>